import $const from './const'
import m from './m'
const keys = $const.messageKey

let injectJS = path=>{
    let script = document.createElement('script')
    script.src = chrome.extension.getURL(path)
    script.type = 'text/javascript'
    script.onload = ()=>script.remove()
    document.querySelector('body').appendChild(script)
}
let injectCSS = path=>{
    let link = document.createElement('link')
    link.rel = 'stylesheet'
    link.type = 'text/css'
    link.href = chrome.extension.getURL(path)
    document.querySelector('head').appendChild(link)
}

window.addEventListener('load', e=>{
    injectJS('inject/index.iife.js')
    // injectCSS('inject/style.css')
})